UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PFu/JL3HR8394YmbxhlB/COqlpGan6TK/il2hwXRdy4=' 
WHERE 
  key_id = '61bcad6e6f16c6567d42564a6a23b4d0544ea94480a053e4ac02c773ebbd0c73' 
  AND (
    token = 'PFu/JL3HR8394YmbxhlB/COqlpGan6TK/il2hwXRdy4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036