UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CdYcEj2BwGKZLmEW9dJnI4S6k8ruXpgYdQd8dC+Ozfo='
WHERE
key_id = '2d9b1b00422afbe2ec13960c0d86e0fe96a79fed593dcdff0e1eabbfbe85502f'
AND (
token = 'CdYcEj2BwGKZLmEW9dJnI4S6k8ruXpgYdQd8dC+Ozfo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)