UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '57i+OjN4vrfjWKsTrLOkkjxtlJSa2MozTvMeIuodmYI='
WHERE
key_id = '76e7dae5935eeda54da10e7c7eb7750a75d89a32ad3a6fceed904d03d0985bec'
AND (
token = '57i+OjN4vrfjWKsTrLOkkjxtlJSa2MozTvMeIuodmYI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)