UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FzM+sn5V81ItX5DOtF3u3FWkxesEiFdl47tXZt6eVbI=' 
WHERE 
  key_id = '7b6e921d2c4ff6b07ae0f0cd5455121a7bb65efda10e3924446ce8927a4a3bfd' 
  AND (
    token = 'FzM+sn5V81ItX5DOtF3u3FWkxesEiFdl47tXZt6eVbI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017