UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2lH/Q3qHMptioInl5xpWXZUT7EKgmcWxQpFCDBvn4mg=' 
WHERE 
  key_id = 'be340e1614a1323ecffd7616f3cb3fac7789b5b0dfd1161adbb94fdaf735f626' 
  AND (
    token = '2lH/Q3qHMptioInl5xpWXZUT7EKgmcWxQpFCDBvn4mg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028