UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1b0K8dPDRHU9D8aqDWvyxNWVbPa8Pp4FDPNfbNNSL1E=' 
WHERE 
  key_id = '9fb6e38f1a7fa480e3a3005b14df285e5f5c8a01ff9a1fe36d71c0b9b9e73fcd' 
  AND (
    token = '1b0K8dPDRHU9D8aqDWvyxNWVbPa8Pp4FDPNfbNNSL1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029