UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SBhZiV8Unm+81l0SIdZBJpgJxrxLb7xCzx93vFvxkbU=' 
WHERE 
  key_id = 'e7505f873e431ddb656d81b597101ae69c275146fdbf5b279ae52b1715f24bfa' 
  AND (
    token = 'SBhZiV8Unm+81l0SIdZBJpgJxrxLb7xCzx93vFvxkbU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032