UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C7OZMJPgOMPwE3+a8EDxxzOhJ4yOpOw3dDfz6xGVi/I='
WHERE
key_id = 'eec3be65ddabbabe3ace17c82d544a4d1cfe83bc6761c612654355d4381f4808'
AND (
token = 'C7OZMJPgOMPwE3+a8EDxxzOhJ4yOpOw3dDfz6xGVi/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)