UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gk1BgykMg0xdgA9o5bCZNbwgZ9XX6MXL/WsLv7NPazI=' 
WHERE 
  key_id = 'b7f50827ab0064be18d06b3d7ef8a109c3ff57b10dce097ec79bb0681485cb30' 
  AND (
    token = 'Gk1BgykMg0xdgA9o5bCZNbwgZ9XX6MXL/WsLv7NPazI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041