UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '69MqPnnPEkdCok8c6kOitn0aQA327uYUHkQu9gO6U9s='
WHERE
key_id = 'ac0fe690fa8da1dfa7ff2249d55be95b787e81383073694d35b395f604a35795'
AND (
token = '69MqPnnPEkdCok8c6kOitn0aQA327uYUHkQu9gO6U9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)