UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G5N1nQ9/6zSuihFMB/BFOJKNhf1vS1rSjBgOsf0qjQw=' 
WHERE 
  key_id = '80e94e1febcede9391c8c26d06ef8f5d2387a3bcb046f4c15ad5e2a3b4b634c0' 
  AND (
    token = 'G5N1nQ9/6zSuihFMB/BFOJKNhf1vS1rSjBgOsf0qjQw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028