UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e9l/zvoOcJGm0XETvFoCg8eQp8vKO9uYPSg0JvtHu0M='
WHERE
key_id = '50920432d65e1337597840f36aeb1a6420c2fb1c8006f228a736c913addd2d39'
AND (
token = 'e9l/zvoOcJGm0XETvFoCg8eQp8vKO9uYPSg0JvtHu0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)