UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6GFF3ssL0YT0SX3PHOLEq/jDZLXL4RiHmuOTOd0rGGs='
WHERE
key_id = '8ea00c6530fa8e5a2a04a0cc0cce8dc2156cd3ba881c9af0d3c5686e74d53f7a'
AND (
token = '6GFF3ssL0YT0SX3PHOLEq/jDZLXL4RiHmuOTOd0rGGs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)