UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dWkQj/RiTPn7Mz+DUgK1bAqy/oRY1NH2Sv7ElSQW7RQ='
WHERE
key_id = 'a5c6f829bbb479ce6442f82c55981da9e00007cd87ef8455357affcf7d019a58'
AND (
token = 'dWkQj/RiTPn7Mz+DUgK1bAqy/oRY1NH2Sv7ElSQW7RQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)