UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k8X8PHe2WAwAyAe46G04elO4LR4vxf2nOJWgRPplKEU='
WHERE
key_id = '407b855dd9fa9590d76364b0caeeed79461aab6ba1f4d8cae9e9e92145999e1c'
AND (
token = 'k8X8PHe2WAwAyAe46G04elO4LR4vxf2nOJWgRPplKEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)