UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GhYECofb0Uw9Jhu1uOg4296t4HAo9/IFjE+JcwcjZE8=' 
WHERE 
  key_id = 'cf4711c24b437bb444bc4e0588e09077c43928c98732d286ec481fae916db07c' 
  AND (
    token = 'GhYECofb0Uw9Jhu1uOg4296t4HAo9/IFjE+JcwcjZE8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034