UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SP2iq6mKZsTywBml5nIYKuAUMKEiwRDB00R+eF03w8M='
WHERE
key_id = 'daf6415f22868105e44682d702be8f0363239c4ea2a593b58008bab4579e6724'
AND (
token = 'SP2iq6mKZsTywBml5nIYKuAUMKEiwRDB00R+eF03w8M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)