UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rqB/eQxfxwb9PhHDiVWltEw3Swq32m5g9M7OHggSISg=' 
WHERE 
  key_id = '8b749698713da74ebd171f3d1e79ba26cd2130ef554f57ddaafcc358cef3a670' 
  AND (
    token = 'rqB/eQxfxwb9PhHDiVWltEw3Swq32m5g9M7OHggSISg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029