UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gZyxWbP0jeYomd04kpIA8CI1HMrx5Hon6MPOdpLLxJ8=' 
WHERE 
  key_id = 'ea3c1dcaac474d5fdd21df3cc383574b5d94608ed4a1a59dfe15fd6d28513d3e' 
  AND (
    token = 'gZyxWbP0jeYomd04kpIA8CI1HMrx5Hon6MPOdpLLxJ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036