UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FDQ/69n9jB1ckCav3ajFP27evZOJKDqPQMLvHKmU+o0=' 
WHERE 
  key_id = 'c03d731985feecacc2eff3423677c92636afeda02c3e513fee9d84ad0ba3e101' 
  AND (
    token = 'FDQ/69n9jB1ckCav3ajFP27evZOJKDqPQMLvHKmU+o0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030