UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lRnrkZZyrv1vpiO0X/MDvVyLYZBPsoxyPw4BTmAF40k='
WHERE
key_id = '649452bd8e952658f3bcb90300100b72bb800040aed01502af2929747c6cdfb3'
AND (
token = 'lRnrkZZyrv1vpiO0X/MDvVyLYZBPsoxyPw4BTmAF40k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)