UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lx/zgdJkjKKvOQbEBOVQlVp3B3wp7DTSQe4OjE0nD3I=' 
WHERE 
  key_id = '89928e77fe9977864c8fcf8c34c8537c8e9f26da0f0cce02c69392f9db024327' 
  AND (
    token = 'Lx/zgdJkjKKvOQbEBOVQlVp3B3wp7DTSQe4OjE0nD3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041