UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TNPU1gIC83httjnNUHfhmSYSrpys47BfRDuViB5ImSU='
WHERE
key_id = '74436534fa4d2f6c0a19ab943cd03e9b10b735b5f0b618b24c7426a4429cef3f'
AND (
token = 'TNPU1gIC83httjnNUHfhmSYSrpys47BfRDuViB5ImSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)