UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FruXCvOwsV9mIMR4NECy55tX9K0Jrma+zcSS6CfBY7Y='
WHERE
key_id = '28003b8d946f0e0c50a8b448f95def96e7534d41751ba2e5873d87d494e422e4'
AND (
token = 'FruXCvOwsV9mIMR4NECy55tX9K0Jrma+zcSS6CfBY7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)