UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QLdvElfXkSTU3Y3aCiLX4nmy8oTUcoFUhk3FW1In/kY='
WHERE
key_id = 'fbd844a04dfcd7db04ff93eae7c2651ce2d6cdcfcc96583bf7002a622c67db92'
AND (
token = 'QLdvElfXkSTU3Y3aCiLX4nmy8oTUcoFUhk3FW1In/kY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)