UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oEudLl/jSrPszwDpRkUXYXJpOcyHq4gRMA8tdsrTYW0='
WHERE
key_id = '56e7e20d1e0233aaeb8d240d7f4102f6f2939a5386ca57198bac6d64b1f42446'
AND (
token = 'oEudLl/jSrPszwDpRkUXYXJpOcyHq4gRMA8tdsrTYW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)