UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ejO86caVPIvLpbEHSfbL8CIvfGc4OVSsHzgW6whevuc='
WHERE
key_id = 'ac9d34a919ee235b069bdfe779607c64ca31c61157a39f9fd4def76847bf3e21'
AND (
token = 'ejO86caVPIvLpbEHSfbL8CIvfGc4OVSsHzgW6whevuc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)