UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xvt5AOchyZsGfNODP64dpZx3UCBeK0rXmkt5yCD2O8g='
WHERE
key_id = '1a60bb07d5e208c8f03527c32465309b84b70237b5304a0ca5bb816e85b9e50a'
AND (
token = 'xvt5AOchyZsGfNODP64dpZx3UCBeK0rXmkt5yCD2O8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)