UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9GQn8uW4P3N7thxHlT/hlTZ7C7i/IUinepFroG49wmY=' 
WHERE 
  key_id = 'a6df667f325486875df172add2828eb5a7e7637fec791021d4784260b60aeeba' 
  AND (
    token = '9GQn8uW4P3N7thxHlT/hlTZ7C7i/IUinepFroG49wmY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016