UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x6S8KmdNP58wQAT3VagwhaGbdZHNcJIQkwVcO5UZQC0='
WHERE
key_id = '5405243c773b21b16448224ab2f5665ec923978483f9b6f4cd3027450e23b427'
AND (
token = 'x6S8KmdNP58wQAT3VagwhaGbdZHNcJIQkwVcO5UZQC0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)