UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XzYbpd9qWTjlcTIzHpRSyocf6uFnOLvElgYKtkiFgR0=' 
WHERE 
  key_id = '92b0aefa1f2822a3eb4a0025884565e8a8e60b328d22af80eb6be27663eda632' 
  AND (
    token = 'XzYbpd9qWTjlcTIzHpRSyocf6uFnOLvElgYKtkiFgR0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041