UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TE3QvaNNfk6c5vIA4wB4w0pjyhNbsXxriwuuN2PbJlE='
WHERE
key_id = '2c95c9972686e74ca9768e7aa62038b2908d42a4ca1a76d586fb3f49a3e993d4'
AND (
token = 'TE3QvaNNfk6c5vIA4wB4w0pjyhNbsXxriwuuN2PbJlE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)