UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tRHenIvQnN/HPTZpsSUFzWAw0pZ6N55mqXMq5iRMo8A='
WHERE
key_id = 'e694d7ebc9600c249dc917b4ed4edaeffa7ca33ce04f11c847653c780056aaea'
AND (
token = 'tRHenIvQnN/HPTZpsSUFzWAw0pZ6N55mqXMq5iRMo8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)