UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xhipsZ/P0M358DGnZ8pKWf3iMYMgD/WqvENa/ju7mr8=' 
WHERE 
  key_id = '868a4eafb63f3fb089ac06ee6b8b63cdf0c9a3b6f214fe59c00a15305eb3cd21' 
  AND (
    token = 'xhipsZ/P0M358DGnZ8pKWf3iMYMgD/WqvENa/ju7mr8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026