UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OUwW6g4iYBss+INVz5SdVpR+POIC6yG2xhCj7DzCbRY='
WHERE
key_id = 'ab64b7e6542c293dbed86940047b7ddb7c1f901948bdefd7031d792f647e2202'
AND (
token = 'OUwW6g4iYBss+INVz5SdVpR+POIC6yG2xhCj7DzCbRY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)