UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'khHL/CvXlvDrKPPSi/1LA9ytlyHWN3jVMFFVTAmU9VI=' 
WHERE 
  key_id = 'dc1aefd1d1208008d7cad5c0627c058f525051505cc65d224739b951c015d19f' 
  AND (
    token = 'khHL/CvXlvDrKPPSi/1LA9ytlyHWN3jVMFFVTAmU9VI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049